<template>
  <view>
    <view class="colorB" style="padding:30rpx;" v-for="(item,index) in orderList" :index="index" :key="index">
      <view class="mainColor border-10" style="border: 1px solid #fff;">
        <view class="padding-10">昵称：{{item.nickName}} （{{item.mobileNumber}}）</view>
        <view class="flex justify-between align-center padding-10">
          <view class="flex color0" style="">
            <navigator :url="'/equipment/orderDetail/orderDetail?orderCode='+ item.orderCode">
              订单编号：{{item.orderCode}}
            </navigator>
            <!-- <uni-icons type="left"></uni-icons> -->
            <u-icon name="file-text" color="#1890FF" size="40" style="margin-left: 6rpx;"
              @click="orderCopy(item.orderCode)" />
          </view>
          <view class="">{{item.orderStatusDescribe}}</view>
        </view>
        <view class="padding-10">站点：{{item.stationName}}</view>

        <view class="padding-10">开始充电时间：{{item.chargeStartTime || '一'}}</view>
        <view class="padding-10">结束充电时间：{{item.chargeEndTime || '一'}}</view>
        <view class="padding-10">订单总金额：{{item.orderAmount}}</view>
        <!-- <view class="padding-10">订单描述状态：</view> -->
        <!-- <view class="padding-10">交易流水号：{{item.transactionCode}}</view> -->

        <!--  <view class="padding-10">电话号码：{{item.mobileNumber}}</view>
        <view class="padding-10">充电桩枪口号：{{item.pileConnectorCode}}</view>
        <view class="padding-10">卡号：{{item.logicCard || '一'}}</view>
        <view class="padding-10">微信商户订单号：{{item.outTradeNo || '一'}}</view>
        <view class="padding-10">启动方式：{{startMode(item.startMode)}}</view>
        <view class="padding-10">支付方式：{{payMode(item.payMode)}}</view>
        <view class="padding-10">支付状态：{{payStatus(item.payStatus)}}</view>
        <view class="padding-10">支付金额：{{item.payAmount || '一'}}</view>
        <view class="padding-10">充电度数：{{item.chargingDegree || '一'}}</view>
        <view class="padding-10">起始SOC：{{item.startSoc || '一'}}</view>
        <view class="padding-10">终止SOC：{{item.endSoc || '一'}}</view> -->

      </view>
    </view>
    <!-- 分页 -->
    <!--  <pagination :queryParams="queryParams" :total="total" @changeNum="changeNum" @changeSize="changeAdd" @reset="reset">
    </pagination> -->
  </view>
</template>
<script>
  import {
    startMode,
    payMode,
    payStatus
  } from '@/common/dict.js'
  import {
    copy
  } from "../../../common/copy";
  export default {
    props: ['orderList'],
    data() {
      return {
        startModeList: [],
        payModeList: [],
        payStatusList: [],
        tableData: [],
        total: 0,
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          orderCode: null,
          transactionCode: null,
          mobileNumber: null,
          orderStatus: null,
          stationId: null,
          startTime: null,
          endTime: null,
        },
      }
    },
    created() {
      // this.getList()
    },
    methods: {
      orderCopy(value) {
        copy(value)
      },
      changeFlag(info) {
        // console.log(info);
        updateStation(info).then((response) => {
          console.log(response, 'xiugai');
          this.$modal.msgSuccess("修改成功");
          this.open = false;
          this.getList();
        });
      },
      // 组件传递的事件 0
      changeNum(e) {
        this.queryParams.pageNum = e
        this.getList()
      },
      changeAdd(e) {
        this.queryParams.pageSize = e
        this.getList()
      },
      reset() {
        this.queryParams.pageSize = 10
        this.queryParams.pageNum = 1
        this.getList();
      },
      // 组件传递的事件 1
      startMode(type) {
        startMode.then(res => {
          this.startModeList = res
        })
        let str = this.startModeList.find(item => {
          return item.dictValue == type
        })
        // console.log(str, 'str');
        if (str == undefined) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
      payMode(type) {
        payMode.then(res => {
          this.payModeList = res
        })
        let str = this.payModeList.find(item => {
          return item.dictValue == type
        })
        if (str == null) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
      payStatus(type) {
        payStatus.then(res => {
          this.payStatusList = res
        })
        let str = this.payStatusList.find(item => {
          return item.dictValue == type
        })
        if (str == null) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
      // payMode(type) {
      //   payMode.then(res => {
      //     this.payModeList = res
      //   })
      //   let str = this.payModeList.find(item => {
      //     return item.dictValue == type
      //   })
      //   if (str == null) {
      //     return '一'
      //   } else {
      //     return str.dictLabel
      //   }
      // },
      // 多选处理
      selectedItems() {
        return this.selectedIndexs.map(i => this.tableData[i])
      },
      // 多选
      selectionChange(e) {
        console.log('多选', e.detail.index)
        this.selectedIndexs = e.detail.index
      },
      //批量删除
      delTable() {
        console.log(this.selectedItems())
      },
      // 分页触发
      change(e) {
        console.log(e.current);
        this.queryParams.pageNum = e.current
        this.getList()
      },
      // 搜索
      search() {
        this.getList(1, this.searchVal)
      }
    }
  }
</script>
<style lang="scss">
  page {
    background-color: $uni-bg-color !important;
  }
</style>
<style lang="scss" scoped>
  .scroll-Y {
    height: 400rpx;
  }

  .uni-group {
    display: flex;
    align-items: center;
  }

  .goods_nav {

    display: flex;

    height: 7%;

    // margin-top: 100rpx;
    // margin-bottom: 100px;
    align-items: center;
    justify-content: space-between;

    .goods_btn {
      // height: 40px;
      width: 50%;
      text-align: center;
      line-height: 40px;
      background: #2979ff;
      border-radius: 45px;
      color: #fff;
    }

  }

  .startBtn {
    width: 50%;
    margin-right: 20rpx;
    text-align: center;
    line-height: 40px;
    border-radius: 45px;
    color: #fff;
    background-color: #2979ff;
  }
</style>